package cn.codenest.springboot.mongo.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;

import java.io.Serializable;

@Data
public class UserEntity implements Serializable {

    public static final String COLLECTION_NAME="user";

    @Id
    private String id;

    private String userName;

    private String password;

    private String email;

    private Integer role;

    private Long createTime;

    private Long updateTime;

    private Integer duty;

    public static UserEntity create(String id, String userName, Integer duty) {
        UserEntity userEntity = new UserEntity();
        userEntity.setId(id);
        userEntity.setDuty(duty);
        userEntity.setUserName(userName);
        return userEntity;
    }

}
